package crm.model.teacherPC.net.job;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import packages.ImagePackage;
import crm.model.NetConst;
import crm.model.teacherPC.net.StudentPC;

public class ScreenShotJob implements Job {
	StudentPC pc;
	
	public ScreenShotJob(StudentPC pc){
		this.pc=pc;
	}
	@Override
	public Object doing(ObjectInputStream is, ObjectOutputStream os) {
		ImagePackage img = null;
		try {
			os.writeObject(NetConst.SCREENSHOT);
			img = (ImagePackage)is.readObject();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		pc.setScreenshot(img.img.getImage());
		
		return null;
	}

}
